# coding: utf8


import pandas as pd
import faker as fk
import random


def fake_data(rows=50):
    fkobj = fk.Faker('zh_CN')
    text = ''
    for j in range(10):
        text += ''.join(fkobj.sentences())
    nolist = [str(j+1).rjust(6, '0') for j in range(rows)]
    namelist = [fkobj.name() for j in range(rows)]
    ywlist = [random.randint(30, 100) for j in range(rows)]
    sxlist = [random.randint(30, 100) for j in range(rows)]
    wylist = [random.randint(30, 100) for j in range(rows)]
    zflist = [x+y+z for x, y, z in zip(ywlist, sxlist, wylist)]
    df = pd.DataFrame(
        data={'学号': nolist, 
              'name': namelist, 
              'yw': ywlist, 
              'sx': sxlist, 
              'wy': wylist, 
              'zf': zflist}
    )
    return df, text
